<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <title>快手用户查询</title>

    <base href="../">
    <meta name="keywords" content="快手用户查询, 快手作品数, 快手用户粉丝数">
    <meta name="description" content="快手用户查询, 快手作品数, 快手用户粉丝数">
    <meta name="referrer" content="no-referrer" /><!-- 外链403的时候尝试屏蔽Referer，有效 -->
    <script src="//lib.baomitu.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="//lib.baomitu.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="//lib.baomitu.com/layer/3.1.1/layer.js"></script>
    <script src="./js/baidutongji.js"></script>
    <!--[if lt IE 9]>
    <script src="//lib.baomitu.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="//lib.baomitu.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link href="//lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="//lib.baomitu.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="./css/oneui.css">
</head>

<body>
    <img style="background: linear-gradient(to bottom,#49BDAD,#6a67c7);" class="full-bg full-bg-bottom animated pulse"
        ondragstart="return false;" oncontextmenu="return false;">
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar">
                    </span>
                    <span class="icon-bar">
                    </span>
                    <span class="icon-bar">
                    </span>
                </button>
                <a class="navbar-brand" id="logo" title="主页" href="#home">
                    二毛的在线工具
                </a>
            </div>
            <!-- end .navbar-header -->
            <div class="navbar-collapse collapse">
                <ul id="menu-primary" class="nav navbar-nav navbar-right">
                    <li>
                        <a href="./v/dy.html" class="dropdown-toggle">
                            抖音作品解析
                        </a>
                    </li>
                    <li>
                        <a href="./v/dy2.html" class="dropdown-toggle">
                            抖音用户查询
                        </a>
                    </li>
                    <li>
                        <a href="./v/ks.html" class="dropdown-toggle">
                            快手作品解析
                        </a>
                    </li>
                    <li>
                        <a href="./v/ks2.html" class="dropdown-toggle">
                            快手用户查询
                        </a>
                    </li>
                    <li>
                        <a href="./tools/ip.html" class="dropdown-toggle">
                            IP定位
                        </a>
                    </li>
                    <li>
                        <a href="./tools/walk.html" class="dropdown-toggle">
                            刷步数
                        </a>
                    </li>
                    <li>
                        <a href="./tools/pan.html" class="dropdown-toggle">
                            查网盘
                        </a>
                    </li><li>
                        <a href="https://news.erma0.cn/" class="dropdown-toggle">
                            看热搜
                        </a>
                    </li>
                </ul>
            </div>
            <!-- end .navbar-collapse -->
        </div>
        <!-- end .container -->
    </nav>
    <div style="padding-top: 150px;">
        <h3 class="font-s36 font-w700 text-uppercase text-white push-10 text-center animated fadeInDown"
            data-toggle="appear" data-class="animated fadeInDown">
            <trans>快手用户查询</trans>
        </h3>
        <p class=" text-uppercase text-white push-10 text-center animated fadeInDown" data-toggle="appear"
            data-class="animated fadeInDown">
            <trans>支持用户ID、主页链接</trans>
            <br>
            <trans><a class="text-white" href="https://gitee.com/erma0/api">[ 接口已开源，点击此处查看 ]</a></trans>
        </p>
        <br>
        <div class="col-sm-8 col-sm-offset-2 col-lg-8 col-lg-offset-4">
            <div class="col-md-6">
                <div class="block">
                    <ul class="nav nav-tabs nav-tabs-alt nav-justified" data-toggle="tabs">
                        <li class="active">
                            <a href="#home">
                                <!-- <i class="fa fa-flag-o text-primary push-5-r"></i> -->
                                <i class="fa fa-filter text-primary push-5-r"></i>
                                <trans>开源的东西 抓接口的都是臭傻B</trans>
                                <!-- <i class="fa fa-flag-o text-primary push-5-r"></i> -->
                                <!-- <i class="fa fa-paw text-primary push-5-l"></i>fa-adjust -->
                            </a>
                        </li>
                    </ul>
                    <div class="block-content tab-content">
                        <div class="tab-pane active in" id="home">
                            <div class="col-sm-12" onkeydown="keydown()">
                                <div class="input-daterange input-group">
                                    <span class="input-group-addon">用户</span>
                                    <input class="form-control" type="text" name="url" placeholder="请输入用户ID或主页链接">
                                </div>
                                <br>
                                <button class="btn btn-primary btn-block" id="jx"
                                    style="background-color: #6a67c7; border-color: #6a67c7;">查询</button>
                            </div>
                        </div>
                    </div>
                    <hr>
                </div>
                <!-- <p style="text-align: center;color: aliceblue;" data-class="animated fadeInDown"> -->
                <p class="text-uppercase push-10 text-center animated fadeInDown" data-toggle="appear"
                    data-class="animated fadeInDown">
                    <trans><a class=" text-white " href="https://erma0.cn/">@二毛 2020</a></trans>
                </p>
            </div>
        </div>
    </div>


    <script>
        $('#jx').click(function () {
            var loading = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });
            var param = $('input[name="url"]').val();
            if (param.indexOf('//') > 0) {
                p = 'url'
            } else {
                p = 'id'
            }
            $.ajax({
                type: "GET",
                url: "https://erma0.cn/api/kuaishou",
                // url: "http://127.0.0.1:2222/kuaishou",
                data: {
                    type: 'user',
                    [p]: param
                },
                dataType: "json",
                // dataType: "jsonp",
                async: true,
                beforeSend: function () {
                    $('#jx').attr('disabled', true).html('解析中');
                },
                success: function (data) {
                    if (data.userId !== undefined) {
                        var layercontent =
                            `<div class="input-group"> <span class="input-group-addon">昵称</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.userName}"> </div> <div class="input-group"> <span class="input-group-addon">账号</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.kuaiId}"> <span class="input-group-addon">UID</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.userId}"> </div> <div class="input-group"> <span class="input-group-addon">签名</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.desc}"> </div> <div class="input-group"> <span class="input-group-addon">作品</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.count}"> </div> <div class="input-group"> <span class="input-group-addon">粉丝</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.fan}"> <span class="input-group-addon">关注</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.follow}"> </div> <div class="input-group"> <span class="input-group-addon">头像</span> <input class="form-control" type="text" onclick="copyContent(this);" value="${data.imgUrl}"> </div>`
                        layer.open({
                            type: 1,
                            title: "解析完成，点击内容复制",
                            shadeClose: true,
                            skin: 'layui-layer-rim',
                            // area: ['360px', '640px'],  //不设置大小，会自适应
                            content: layercontent //放到上方定义，变量必须先定义后调用
                        });
                    } else {
                        layer.alert(data.error, {
                            icon: 2
                        });
                    }
                    $('#jx').attr('disabled', false).html('解析');
                    layer.close(loading);
                },
                error: function () {
                    layer.alert('请求出错！', {
                        icon: 2
                    });
                    $('#jx').attr('disabled', false).html('解析');
                    layer.close(loading);
                }
            });
        });
        // 弹出视频播放界面
        function openVideo(url) {
            //iframe层-多媒体
            layer.open({
                type: 2,
                title: false,
                area: ['320px', '568px'], //无法自适应，固定为苹果5S的屏幕大小（比一般手机屏幕小）
                shade: 0.8,
                closeBtn: 0, //去掉右上角的×
                shadeClose: true,
                content: url.slice(url.indexOf('//'))
            });
        }
        // 点击复制
        function copyContent(inputElement) {
            // // 取父节点（parentNode）的上一个兄弟节点（previousElementSibling;）
            // var inputElement = ElementObj.parentNode.previousElementSibling;
            //选中input框的内容
            inputElement.select();
            // 执行浏览器复制命令
            document.execCommand("Copy");
            // 取消选中
            inputElement.blur();
            //提示已复制
            // alert('已复制')
            layer.msg('已复制');
        }
        // 按下回车键
        function keydown() {
            console.log(event.keyCode)
            if (event.keyCode == 13) {
                $('#jx').click()
            }
        }
    </script>

</body>

</html>